package com.edu.service.food;

import com.edu.dao.FoodDao;
import com.edu.entity.Food;
import com.edu.utils.PageList;
import com.edu.utils.PageParam;

import java.sql.SQLException;
import java.util.List;

/**
 * @Author ZCN
 * @Date 2021/11/14 2:22
 * @Version 1.0
 **/
public class FoodServiceImpl implements FoodService {
    private FoodDao foodDao = new FoodDao();

    @Override
    public PageList pageList(PageParam pageParam) throws Exception {
        return foodDao.pageList(pageParam);
    }

    @Override
    public List<Object> getHotsFood() throws SQLException {
        return foodDao.getHotsFood();
    }

    @Override
    public List<Object> getCookRecommentFoods() throws SQLException {
        return foodDao.getcookRecomment();
    }

    @Override
    public List<Food> findAll() throws SQLException {
        return foodDao.findAll();
    }

    @Override
    public Food findOne(Integer id) throws SQLException {
        return foodDao.findOne(id);
    }

    @Override
    public void update(Food food) throws SQLException {
        foodDao.update(food);
    }

    @Override
    public void delete(Integer id) throws SQLException {
        foodDao.delete(id);
    }

    @Override
    public void online(Integer id) throws SQLException {
        foodDao.online(id);
    }

    @Override
    public void insert(Food food) throws SQLException {
        foodDao.insert(food);
    }
}
